package org.apache.rocketmq.store.queue;

import org.apache.rocketmq.common.BoundaryType;
import org.apache.rocketmq.common.Pair;
import org.apache.rocketmq.common.attribute.CQType;
import org.apache.rocketmq.common.message.MessageExtBrokerInner;
import org.apache.rocketmq.store.DispatchRequest;
import org.apache.rocketmq.store.MessageFilter;
import org.rocksdb.RocksDBException;


public interface ConsumeQueueInterface extends FileQueueLifeCycle{

    String getTopic();

    int getQueueId();

    //ReferredIterator<CqUnit> iterateFrom(long startIndex);

    //ReferredIterator<CqUnit> iterateFrom(long startIndex, int count) throws RocksDBException;

    //CqUnit get(long index);

    //Pair<CqUnit, Long> getCqUnitAndStoreTime(long index);

    //Pair<CqUnit, Long> getEarliestUnitAndStoreTime();

    //CqUnit getEarliestUnit();

    //CqUnit getLatestUnit();

    long getLastOffset();

    long getMinOffsetInQueue();

    long getMaxOffsetInQueue();

    long getMessageTotalInQueue();

    long getOffsetInQueueByTime(final long timestamp);

    long getOffsetInQueueByTime(final long timestamp, final BoundaryType boundaryType);

    long getMaxPhysicOffset();

    long getMinLogicOffset();

    CQType getCQType();

    long getTotalSize();

    int getUnitSize();

    void correctMinOffset(long minCommitLogOffset);

    void putMessagePositionInfoWrapper(DispatchRequest request);

    void assignQueueOffset(QueueOffsetOperator queueOffsetAssigner, MessageExtBrokerInner msg) throws RocksDBException;

    void increaseQueueOffset(QueueOffsetOperator queueOffsetAssigner, MessageExtBrokerInner msg, short messageNum);

    long estimateMessageCount(long from, long to, MessageFilter filter);
}
